<template>
	<view class="close" @click="close('close')">
		<view class="closeButton"></view>
	</view>
</template>

<script>
	//关闭按钮组件
	//@group 全局组件
	export default {
		name: 'close',
		methods: {
			close: function() {
				//点击关闭按钮的回调
				//@arg 向父组件传递关闭事件，值为close）
				this.$emit('close:click', 'close');
			}
		}
	}
</script>

<style lang="scss" scoped>
	.close {
		position: relative;
		width: 100%;
		height: 60rpx;

		.closeButton {
			background: url('');
			background-size: 40rpx 40rpx;
			background-repeat: no-repeat;
			position: absolute;
			top: 0rpx;
			right: 24rpx;
			width: 40rpx;
			height: 40rpx;
			text-align: center;
			line-height: 40rpx;
		}
	}
</style>